<? if(!empty ($offer) || 1) { 
    $offer = $this->offer
            ?>
    <table class="datalist" width="100%">
            <thead>
                <tr>
                    <th colspan="2">Oferta</th>  
                    <td> #<? echo $offer->getOffer_id(); ?></td>
                </tr>
            </thead>
            <tbody>
                <tr>
                    <td colspan="2">Max wiązek</td>
                    <td><? echo $offer->getMaxVolume(); ?></td>    
                </tr>
                <? $components = $offer->getComponents(); ?>
                <?                
                foreach ($components as $component){
                ?>
                <tr>
                    <th scope="row" width="40%"><? echo $component->getCommodity()->getName(); ?></th>
                    <td  width="30%"><? if($component->getShareFactor() == -1){
                             echo 'Sprzedaż';
                         } elseif($component->getShareFactor() == 1) {
                             echo 'Kupno';
                         }
                    ?></td>
                    <td  width="30%"><? echo $component->getQuantity()?></td>
                </tr> 
                <? } ?>
                <tr>
                    <td colspan="2">
                        Koszt
                    </td>
                    <td>
                        <? echo $offer->getOfferedPrice(); ?>
                    </td>
                </tr>
            </tbody>
    </table>
<? } ?> 
